package com.ccc.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Stockinfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "stockinfo")
public class Stockinfo implements java.io.Serializable {

	// Fields

	private Integer id;
	private Product product;
	private User user;
	private Integer inStockCount;
	private Integer outStockCount;
	private Integer currentTime;
	private Integer inStockPrice;
	private Integer outStockPrice;

	// Constructors

	/** default constructor */
	public Stockinfo() {
	}

	/** full constructor */
	public Stockinfo(Product product, User user, Integer inStockCount,
			Integer outStockCount, Integer currentTime, Integer inStockPrice,
			Integer outStockPrice) {
		this.product = product;
		this.user = user;
		this.inStockCount = inStockCount;
		this.outStockCount = outStockCount;
		this.currentTime = currentTime;
		this.inStockPrice = inStockPrice;
		this.outStockPrice = outStockPrice;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "productId")
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "inStockCount")
	public Integer getInStockCount() {
		return this.inStockCount;
	}

	public void setInStockCount(Integer inStockCount) {
		this.inStockCount = inStockCount;
	}

	@Column(name = "outStockCount")
	public Integer getOutStockCount() {
		return this.outStockCount;
	}

	public void setOutStockCount(Integer outStockCount) {
		this.outStockCount = outStockCount;
	}

	@Column(name = "currentTime")
	public Integer getCurrentTime() {
		return this.currentTime;
	}

	public void setCurrentTime(Integer currentTime) {
		this.currentTime = currentTime;
	}

	@Column(name = "inStockPrice")
	public Integer getInStockPrice() {
		return this.inStockPrice;
	}

	public void setInStockPrice(Integer inStockPrice) {
		this.inStockPrice = inStockPrice;
	}

	@Column(name = "outStockPrice")
	public Integer getOutStockPrice() {
		return this.outStockPrice;
	}

	public void setOutStockPrice(Integer outStockPrice) {
		this.outStockPrice = outStockPrice;
	}

}